package com.smile.api;

import com.smile.commons.page.R;
import com.smile.model.request.GetOrganizationByIdRequest;
import com.smile.model.request.GetOrganizationListRequest;
import com.smile.model.response.GetOrganizationByIdResponse;
import com.smile.model.response.GetOrganizationByIdsResponse;
import com.smile.model.response.GetOrganizationListResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.List;
import java.util.Map;

@FeignClient(name = "smile-plus-standalone-user"
        , contextId = "organization",
        path = "/api/user")
public interface OrganizationApi {

    @PostMapping(value = "/organization/getOrganizationById", produces = MediaType.APPLICATION_JSON_VALUE)
    R<GetOrganizationByIdResponse> getOrganizationById(@RequestBody GetOrganizationByIdRequest getOrganizationById);

    @RequestMapping(value = "/organization/getOrganizationByIds", produces = MediaType.APPLICATION_JSON_VALUE, method = {RequestMethod.POST})
    R<Map<Long, GetOrganizationByIdsResponse>> getOrganizationByIds(@RequestBody List<Long> ids);

    @RequestMapping(value = "/organization/getDeviceList", produces = MediaType.APPLICATION_JSON_VALUE, method = {RequestMethod.POST})
    R<List<GetOrganizationListResponse>> getDeviceList( GetOrganizationListRequest getOrganizationListRequest);

    @RequestMapping(value = "/organization/list", produces = MediaType.APPLICATION_JSON_VALUE, method = {RequestMethod.POST})
    R<List<GetOrganizationListResponse>> list( GetOrganizationListRequest getOrganizationListRequest);
}
